home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-10 | 3.1 KB | 94 lines | [TEXT/MPS ] |
- (*
- File: Perf.mod
-
- Copyright: © 1983-1993 by Apple Computer, Inc.
- All rights reserved.
-
- Version: System 7.1 for ETO #11
- Created: Tuesday, March 30, 1993 18:00
-
- *)
-
- (*$TAGS-*)
- (*$CALLING PASCAL*)
- MODULE Perf;
-
- IMPORT SYSTEM, Types;
-
- TYPE
-
- PLongs* = POINTER TO ALongs;
- ALongs* = ARRAY 8001 (*ΔΔ[1..8000]ΔΔ*) OF LONGINT;
-
- PInts* = POINTER TO AInts;
- HInts* = HANDLE TO AInts (*ΔΔ POINTER TO PInts*);
-
- AInts* = ARRAY 8001 (*ΔΔ[1..8000]ΔΔ*) OF INTEGER;
-
- (* PerfGlobals are declared as a record, so main program can allocate
- as globals, desk accessory can add to globals allocated via pointer,
- print driver can allocate via low memory, etc. *)
-
-
- TP2PerfGlobals* = POINTER TO TPerfGlobals;
- TPerfGlobals* = RECORD
- startROM*: LONGINT; (*ROM Base*)
- romHits*: LONGINT; (*used if MeasureROM is false*)
- misses*: LONGINT; (*count of PC values outside measured memory*)
- segArray*: PLongs; (*array of segment handles*)
- sizeArray*: PLongs; (*array of segment sizes*)
- idArray*: HInts; (*array of segment rsrc IDs*)
- baseArray*: PLongs; (*array of offsets to counters for each segment*)
- samples*: PLongs; (*samples buffer*)
- buffSize*: LONGINT; (*size of samples buffer in bytes*)
- timeInterval*: INTEGER; (*number of clock intervals between interrupts*)
- bucketSize*: INTEGER; (*size of buckets power of 2*)
- log2buckSize*: INTEGER; (*used in CvtPC*)
- pcOffset*: INTEGER; (*offset to the user PC at interrupt time.*)
- numMeasure*: INTEGER; (*# Code segments (w/o jump table)- ROM etc.*)
- firstCode*: INTEGER; (*index of first Code segment*)
- takingSamples*: BOOLEAN; (*true if sampling is enabled*)
- measureROM*: BOOLEAN;
- measureCode*: BOOLEAN;
- ramSeg*: INTEGER; (*index of "segment" record to cover RAM > 0 if RAM (misses) are to be bucketed.*)
- ramBase*: LONGINT; (*beginning of RAM being measured.*)
- measureRAMbucketSize*: INTEGER;
- measureRAMlog2buckSize*: INTEGER;
- romVersion*: INTEGER;
- vRefNum*: INTEGER; (*Volume where the report file is to be created*)
- volumeSelected*: BOOLEAN; (*True if user selects the report file name*)
- rptFileName*: Types.Str255; (*Report file name*)
- rptFileCreator*: Types.Str255; (*Report File Creator*)
- rptFileType*: Types.Str255; (*Report File type*)
- getResType*: Types.ResType; (*Resource type*)
- END;
-
-
-
- PROCEDURE InitPerf*(VAR thePerfGlobals: TP2PerfGlobals;timerCount: INTEGER;
- codeAndROMBucketSize: INTEGER;doROM: BOOLEAN;doAppCode: BOOLEAN;appCodeType: Types.Str255;
- romID: INTEGER;romName: Types.Str255;doRAM: BOOLEAN;ramLow: LONGINT;ramHigh: LONGINT;
- ramBucketSize: INTEGER): BOOLEAN;
- EXTERNAL PASCAL;
- (* called once to setup Performance monitoring
- *)
-
- PROCEDURE TermPerf*(thePerfGlobals: TP2PerfGlobals);
- EXTERNAL PASCAL;
- (* if InitPerf succeeds then TermPerf must be called before terminating program.
- *)
-
- PROCEDURE PerfControl*(thePerfGlobals: TP2PerfGlobals;turnOn: BOOLEAN): BOOLEAN;
- EXTERNAL PASCAL;
- (* Call this to turn off/on measuring.
- Returns previous state.
- *)
-
- PROCEDURE PerfDump*(thePerfGlobals: TP2PerfGlobals;reportFile: Types.Str255;doHistogram: BOOLEAN;
- rptFileColumns: INTEGER): INTEGER;
- EXTERNAL PASCAL;
- (* Call this to dump the statistics into a file. *)
-
-
- END Perf.
-